package com.ysl.study.designpattern.structure.decoration;

import java.math.BigDecimal;

/**
 * 装饰器模式测试
 *
 * @author yangshanlin
 * @date 2023/2/23 18:25
 * @describe
 */
public class DecorationTest {
    public static void main(String[] args) {

        Person person = new Person("老王", BigDecimal.TEN);
        System.out.println(person.getName()+"基本战力："+person.getFight());
        XiangLongShiBaZhang hat = new XiangLongShiBaZhang(person, new BigDecimal(20));
        DaGouBangFa shortSleeve = new DaGouBangFa(hat, new BigDecimal(40));

        System.out.println(person.getName()+"的伤害：" + shortSleeve.attack());
    }
}

